﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CaliburnWpf.Views.Infrastructure;

namespace CaliburnWpf.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class ShellView : Window
    {
        public ShellView()
        {
            InitializeComponent();
        }

      
        private void Selected_Home(object sender, RoutedEventArgs e)
        {
            var vm = Caliburn.Micro.ViewModelLocator.LocateForView(this) as CaliburnWpf.ViewModels.ShellViewModel;
            //vm.SelectNode(tree.SelectedValue);
            e.Handled = true;
        }


        private void OnItemSelected(object sender, RoutedEventArgs e)
        {
            var obj = e.OriginalSource as TreeViewItem;
            SelectedPath = ViewHelper.GetPathFor(obj);
        }

        public object[] SelectedPath
        {
            get
            {
                return ViewHelper.GetSelectedPath(tree);
            }
            set
            {
                ViewHelper.SetSelectedPath(tree, value);
            }
        }
        
    }
}
